package lol.clann.bukkit.pluginboot.util;

import lol.clann.clannboot.annotation.svc.Service;
import org.bukkit.Material;

import javax.annotation.Nullable;

/**
 * @author pyz
 * @date 2018/8/11 下午5:32
 */
@Service(priority = Integer.MAX_VALUE)
public class MaterialUtils {

    @Nullable
    public Integer name2Id(String name) {
        Material m = Material.getMaterial(name);
        if (m != null) {
            return m.getId();
        } else {
            return null;
        }
    }

}
